HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: /var/www/kevin-demo/wp-content/plugins/woocommerce-services/src/StoreApi/StoreApiExtendSchema.php
<?php
/**
 * StoreApiExtendSchema class.
 *
 * Wrapper class for the ExtendSchema instance.
 *
 * @package Automattic/WCServices
 */

namespace Automattic\WCServices\StoreApi;

use Automattic\WooCommerce\StoreApi\Schemas\ExtendSchema;
use Automattic\WooCommerce\StoreApi\StoreApi;
use Exception;

defined( 'ABSPATH' ) || exit;

/**
 * StoreApiExtendSchema class.
 */
class StoreApiExtendSchema {
	/**
	 * Stores Store API ExtendSchema instance.
	 *
	 * @var ExtendSchema
	 */
	private static ExtendSchema $instance;

	/**
	 * Plugin Identifier
	 *
	 * @var string
	 */
	const IDENTIFIER = 'woocommerce-services';

	/**
	 * ExtendSchemaService constructor.
	 */
	private function __construct() {
		try {
			self::$instance = StoreApi::container()->get( ExtendSchema::class );
		} catch ( Exception $e ) {
			wc_get_logger()->debug( 'Failed to get ExtendSchema instance.', array( 'exception' => $e ) );
		}
	}

	/**
	 * Returns the ExtendSchema instance.
	 */
	public static function instance(): ExtendSchema {
		if ( ! isset( self::$instance ) ) {
			new self();
		}

		return self::$instance;
	}
}